PowerPoint:
PowerPoint

برنامه:
winWeb

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.Net;
using System.IO;
using System.Net.Mail;

namespace winWeb
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{


FtpWebRequest f = (FtpWebRequest)WebRequest.Create("ftp://localhost/alaki/mytest.txt");
//f.Credentials = new NetworkCredential("username", "password");
FtpWebResponse res = (FtpWebResponse)f.GetResponse();
Stream s= res.GetResponseStream();
StreamReader sr = new StreamReader(s);
textBox1.Text= sr.ReadToEnd();
}

private void button2_Click(object sender, EventArgs e)
{
WebClient w = new WebClient();
//w.Credentials = new NetworkCredential("username", "password");
w.DownloadFile("ftp://localhost/alaki/mytest.txt", "c:\\me.tr");
}

private void button3_Click(object sender, EventArgs e)
{
WebClient w = new WebClient();
w.UploadFile("ftp://localhost/alaki/mytest.t", "c:\\MyTest.txt");
}

private void button4_Click(object sender, EventArgs e)
{
WebBrowser wb = new WebBrowser();
wb.Navigate("http://localhost/", true);

}

private void button5_Click(object sender, EventArgs e)
{
string s1 = Uri.EscapeUriString(" ");
string s2 = Uri.EscapeUriString("&");
string s3 = Uri.HexEscape('a');

Uri u = new Uri("http://babolbazar.com/index.aspx?a=12");
//u.Query;
//u.AbsolutePath;
//u.AbsolutePath;
}

private void button6_Click(object sender, EventArgs e)
{
IPAddress ip = IPAddress.Parse("127.0.0.1");
ip = IPAddress.Loopback;
ip = IPAddress.Any;
ip = IPAddress.Broadcast;

IPEndPoint ipe = new IPEndPoint(ip, 80);

IPHostEntry iph = Dns.Resolve("localhost");
textBox1.Text = "";
foreach (IPAddress ip1 in iph.AddressList)
{
textBox1.Text += ip1.ToString();
}

iph = Dns.GetHostByAddress("127.0.0.1");
//iph.HostName;

}

private void Form1_Load(object sender, EventArgs e)
{

}

private void button7_Click(object sender, EventArgs e)
{
SmtpClient sc = new SmtpClient();
MailMessage mm = new MailMessage();

//mm.
//Attachment a = new Attachment("ssss.pdf");
//mm.Attachments.Add(a);
sc.Send(mm);
sc.Send("", "a@a.com,b@b.com", "title", "body");


}
}
}


بااحترام، NIIT

موضوعات مشابه: